/**
 * Copyright (C) 2024-2030 Super BilGen & 超亿时代信息技术股份有限公司.All Rights Reserved.
 */
package cn.com.yang.chain;

/**
 * @Model cn.com.yang.chain.LoggerChainDemo
 * @Desc  TODO
 * @author yangyijin
 * @since 2025年3月29日-上午10:49:29
 */
public class LoggerChainDemo {
	
	private static YLogger getChainLogger() {
		AbstractLogger errLogger = new ErrorLogger(AbstractLogger.ERROR);
		AbstractLogger infoLogger = new InfoLogger(AbstractLogger.INFO);
		AbstractLogger debugLogger = new DebugLogger(AbstractLogger.DEBUG);
		AbstractLogger consoleLogger = new ConsoleLogger(AbstractLogger.CONSOLE);
		errLogger.setNextLogger(infoLogger);
		infoLogger.setNextLogger(debugLogger);
		debugLogger.setNextLogger(consoleLogger);
		return errLogger;
	}
	public static void main(String[] args) {
		YLogger logger = getChainLogger();
		logger.logMessage(AbstractLogger.ERROR, "This is a error message");
	}
}
